import { inintList, iniSetList, list, Pinglunx, Terchang, itemimg, SiXun ,imaage,addpinglun} from "../../api/api"
export const getList = () => {
    return async (dispatch) => {
        let res = await inintList()
        console.log(res);
        dispatch({
            type: "INIT_INITLIST",
            data: res.data.data
        })
    }
}

export const initsetList = () => {
    return async (dispatch) => {
        let res = await iniSetList()
        console.log(res);
        dispatch({
            type: "INIT_INITLIST_SET",
            data: res.data.data
        })
    }
}
export const lists = (params) => {
    return async (dispatch) => {
        let res = await list(params)
        console.log(res);
        dispatch({
            type: "SZD_FXGC_HJLK",
            data: res.data.rows,
            total: res.data.total
        })
    }
}
export const pingLun = (params) => {//项目详情评论接口
    return async (dispatch) => {
        let res = await Pinglunx(params)
        console.log(res);
        dispatch({
            type: "PIN_GLUN_JIE_KOU",
            data: res.data.rows,
            total: res.data.total
        })
    }
}
export const Terchangs = (id) => {//获取指导老师的接口
    return async (dispatch) => {
        let res = await Terchang(id)
        let data = await itemimg(id)
        let shixun = await SiXun()
        let asdfgh=await imaage()
        console.log(shixun);
        console.log(res);
        console.log(asdfgh);
        dispatch({
            type: "PIN_GLUN_JIE_KOU_VDFBFD",
            data: res.data.data,
            img: data.data.data,
            xiangmu: shixun.data.data,
            imasgg:asdfgh.data.user

        })
    }
}

// export const addps = (params) => {
//     return async (dispatch) => {
//         let res = await addpinglun(params)
//         console.log(res);
//         dispatch({
//             type:"KGJI_DGS_FKSK",
            

//         })
//     }
// }